Data compression and decompression

ABSTRACT

Apparatus comprises data compression circuitry to process a set of data values, the data compression circuitry comprising: detector circuitry to detect, for each of n complementary groups of m data values of the set of data values, a first subset of the groups for which the data values in the group have a predetermined pattern of data values, where m and n are integers and m×n is the number of data values in the set of data values; generator circuitry to generate a compressed data packet comprising at least: a representation of a second subset of the groups, the second subset being each of then complementary groups other than groups in the first subset; and an indication of a group position, with respect to the set of data values, of each group in the second subset of groups. Complementary decompression apparatus is also described.

BACKGROUND

This disclosure relates to data compression and decompression.

By way of example, some data transfers, for example between graphicsprocessing units (GPUs) and memory systems, involve transferring datablocks of a block size such as 512 bits (64 bytes). Depending on a buswidth applicable to the transfer of a data block, it can require severalindividual transfers or “beats”, each of a part of the data block, totransfer the whole block. In the context of processing operations suchas the use of a GPU, the resources required for the transfer of suchdata blocks can be a limiting factor on the performance of the overallsystem and in some circumstances can lead to undesired powerconsumption.

SUMMARY

In an example arrangement there is provided apparatus comprising:

-   -   data compression circuitry to process a set of data values, the        data compression circuitry comprising:    -   detector circuitry to detect, for each of n complementary groups        of m data values of the set of data values, a first subset of        the groups for which the data values in the group have a        predetermined pattern of data values, where m and n are integers        and m×n is the number of data values in the set of data values;    -   generator circuitry to generate a compressed data packet        comprising at least:    -   a representation of a second subset of the groups, the second        subset being each of the n complementary groups other than        groups in the first subset; and    -   an indication of a group position, with respect to the set of        data values, of each group in the second subset of groups.

In another example arrangement there is provided data processingapparatus comprising:

-   -   a first processing node;    -   a second processing node;    -   a data interconnection between the first processing node and the        second processing node; and    -   data compression circuitry to compress a set of data values to        be transmitted via the data interconnection from the first        processing node to the second processing node, the data        compression circuitry comprising:    -   detector circuitry to detect, for each of n complementary groups        of m data values of the set of data values, a first subset of        the groups for which the data values in the group have a        predetermined pattern of data values, where m and n are integers        and m×n is the number of data values in the set of data values;        and    -   generator circuitry to generate a compressed data packet        comprising at least:    -   a representation of a second subset of the groups, the second        subset being each of the n complementary groups other than        groups in the first subset; and    -   an indication of a group position, with respect to the set of        data values, of each group in the second subset of groups.

In another example arrangement there is provided apparatus comprising:

-   -   data decompression circuitry to process a compressed data packet        to generate a set of output data values, the compressed data        packet comprising at least a representation of a subset of n        complementary groups of m data values of a set of output data        values, and an indication of a group position, with respect to        the set of output data values, of each group in the subset of        groups;    -   the data decompression circuitry being configured to assemble        the set of output data values by inserting the subset of groups        at their respective group positions and setting other groups of        data values of the set of output data values to a predetermined        pattern of data values.

In another example arrangement there is provided a data compressionmethod comprising:

-   -   detecting, for each of n complementary groups of m data values        of the set of data values, a first subset of the groups for        which all of the data values in the group have a predetermined        pattern of data values, where m and n are integers and m×n is        the number of data values in the set of data values; and    -   generating a compressed data packet comprising at least:    -   a representation of a second subset of the groups, the second        subset being each of the n complementary groups other than        groups in the first subset; and    -   an indication of a group position, with respect to the set of        data values, of each group in the second subset of groups.

In another example arrangement there is provided a data decompressionmethod comprising:

-   -   processing a compressed data packet to generate a set of output        data values, the compressed data packet comprising at least a        representation of a subset of n complementary groups of m data        values of a set of output data values, and an indication of a        group position, with respect to the set of output data values,        of each group in the subset of groups;    -   assembling the set of output data values by inserting the subset        of groups at their respective group positions and setting other        groups of data values to a predetermined pattern of data values.

Further respective aspects and features of the present technology aredefined by the appended claims.

BRIEF DESCRIPTION OF THE DRAWINGS

The present technique will be described further, by way of example only,with reference to embodiments thereof as illustrated in the accompanyingdrawings, in which:

FIG. 1 schematically illustrates a data processing apparatus;

FIG. 2 schematically illustrates data compression and decompression inthe apparatus of FIG. 1;

FIG. 3 schematically illustrates a data block;

FIG. 4 schematically illustrates a compressed version of the data blockof FIG. 3;

FIG. 5 schematically illustrates a data block;

FIG. 6 schematically illustrates a compressed version of the data blockof FIG. 5;

FIG. 7a schematically illustrates a data block after applying an XORoperation with a data pattern;

FIG. 7b schematically illustrates a compressed version of the data blockof FIG. 7 a;

FIG. 8 schematically illustrates a data block;

FIG. 9 schematically illustrates the processing of the data block ofFIG. 8;

FIG. 10 schematically illustrates a compressed version of the data blockof FIG. 8;

FIGS. 11a to 11c schematically illustrate a further compression example;

FIG. 12a schematically illustrates a data compression apparatus;

FIG. 12b schematically illustrates a key processor;

FIG. 13 schematically illustrates a data compression apparatus;

FIG. 14 schematically illustrates a compressed data packet;

FIG. 15 schematically illustrates a set of options for use with theapparatus of FIG. 13;

FIG. 16a schematically illustrates a data decompression apparatus;

FIG. 16b schematically illustrates an output buffer;

FIG. 17 schematically illustrates a data decompression apparatus; and

FIGS. 18 and 19 are schematic flowcharts illustrating respectivemethods.

DESCRIPTION OF EMBODIMENTS

Before discussing the embodiments with reference to the accompanyingfigures, the following description of embodiments is provided.

An example embodiment provides apparatus comprising:

-   -   data compression circuitry to process a set of data values, the        data compression circuitry comprising:    -   detector circuitry to detect, for each of n complementary groups        of m data values of the set of data values, a first subset of        the groups for which the data values in the group have a        predetermined pattern of data values, where m and n are integers        and m×n is the number of data values in the set of data values;    -   generator circuitry to generate a compressed data packet        comprising at least:    -   a representation of a second subset of the groups, the second        subset being each of the n complementary groups other than        groups in the first subset; and    -   an indication of a group position, with respect to the set of        data values, of each group in the second subset of groups.

As discussed above, it would be desirable to improve the efficiency ofthe transfer of data blocks (or sets of data values). Data compression(at a sending node) and decompression (at a receiving node) couldprovide a solution to this.

Previously proposed data compression and decompression techniques canpotentially suffer from two main disadvantages: a first is that they canrequire a complex encoder and decoder design, potentially addinglatency, power consumption and area (in the case of an integratedcircuit implementation); and a second is that they can require priorinformation about the nature or type of the information beingtransferred.

The present disclosure concerns a technique which is potentially capableof compressing data blocks or sets of data values for transfer. Thedisclosure recognises the following features of data transfers in thecontext of processing units transferring to and from memory, forexample. These are that data blocks may contain fixed or predeterminedpatterns, for example because unused parts of such data blocks may bepadded with zeros or ones; and such data blocks may contain repeatedsimilar patterns of (for example) 16, 32 or 64 bits, corresponding tothe typical and native data widths of contemporary processing units atthe time of filing.

In the present disclosure, a data block is considered as a number ofcomplementary groups of data values. Some of these may contain apredetermined pattern of data values, in which case they are nottransmitted. Instead, they can be reconstructed at the receiver side byinserting the predetermined pattern of data values. Other groups aretransmitted, at least in the form of a representation of those groups,along with an indication of the location or position, in the data block,of each such group.

By avoiding the transmission of any groups with the predeterminedpattern, a saving in data quantity, latency, power consumption or thelike can potentially be achieved. This can reduce (for example) thenumber of data beats needed to transmit the compressed version of thedata block, compared to the raw (original, uncompressed) data block.

In various examples, column-based encoding works efficiently on inputdata that has high correlation (similarity) in different every nth datavalue. Row-based encoding works efficiently on input data that hasrecurring pattern (zeros or other pattern) in different m contiguousdata values. Varying the m×n selection enables the compression to workefficiently for different native data sizes (8-bit, 16-bit, 32-bit, . .. ) without the compression or decompression arrangements needing toknow anything about the nature of the data (floating point, fixed point,integer or the like).

The predetermined pattern can be any pattern recognisable at thecompression side and which can be reconstructed at the decompressionside, such as 10101010101 . . . However, in example arrangements, thepredetermined pattern comprises all data values in the group having apredetermined data value such as 0. This can be particularly useful insituations where portions of the data block may be padded with zeros.

In order to apply the compression technique only when it leads to anadvantage in terms of data quantity, example arrangements provide outputcircuitry to output either the set of data values (the raw data) or thecompressed data packet, in dependence upon which of the set of datavalues and the compressed data packet represents a smaller amount ofdata.

The division of the original data block or set of data values intogroups can be carried out such that the groups of data values comprisegroups of m contiguous data values of the set of data values; or groupsof every nth data value of the set of data values. The data block can beenvisaged as being rearranged into a rectangular array of values,populated in a raster pattern from one corner of the array. In such anexample, the first of these group types could represent rows within thearray, and the second group type could represent columns within thearray. However, note that this is a visualisation to assist inunderstanding rather than necessarily representing a physical or logicalfeature of the apparatus.

In order to potentially increase the number of such groups which havethe predetermined pattern, in some examples in which the data valuescomprise respective data bits, the data compression circuitry cancomprise combiner circuitry to combine each group of m data values withbits of an k-bit key group applied contiguously to the set of datavalues to generate a respective combined group, the detector circuitryoperating with respect to the combined groups. This can reduce thevarying content, so leading to a potentially greater number of columnsor rows containing the predetermined value in the input data. Thecombination can be selected from the list consisting of: (i) a bitwiseexclusive-OR combination to each group of m data values and bits of thek-bit key group; and (ii) an arithmetic combination of each group of mdata values and bits of the k-bit key group. In either case, thecombination can be applied at the compression side and reversed at thedecompression side. To assist in such reversal, in example arrangementsthe compressed data packet includes a representation of the k-bit keygroup. The combiner circuitry at the compression side may be configuredto generate the k-bit key group, for example by setting each bitposition of the coding value to one when at least a threshold proportionof instances (such as all instances) of the m-bit groups have a one atthat bit position. For example, k could equal m, 2 m, 0.5 m, or anothervalue whether or not an integer multiple or sub-multiple of m.

The apparatus can test multiple candidate compressions and select thebest outcome (which could be the raw data as discussed above). Forexample, two or more instances of data compression circuitry may beprovided to perform data compression to generate respective compresseddata packets using:

-   -   groups of m contiguous data values of the set of data values        (rows, in the visualisation discussed above); and    -   groups of every nth data value of the set of data values        (columns in the visualisation discussed above);    -   in which:    -   the output circuitry is configured to output either the set of        data values or one of the compressed data packets, in dependence        upon which of the set of data values and the compressed data        packets represents a smaller amount of data.

In other examples, the row and/or column size can be varied, given thatthe compression apparatus does not have prior knowledge about the datawidths or padding of the data block. For example, the apparatus maycomprise at least four instances of data compression circuitry, toperform data compression to generate respective compressed data packetsusing:

-   -   (i) groups of m contiguous data values of the set of data values        for a first value of m;    -   (ii) groups of every nth data value of the set of data values        for a first value of n;    -   (iii) groups of m contiguous data values of the set of data        values for a second value of m; and    -   (iv) groups of every nth data value of the set of data values        for a second value of n.

Again, the output circuitry can select the most appropriate form of thedata as discussed above.

In some examples, the first value of m is equal to the second value ofn; and the second value of m is equal to the first value of n. Examplesare m=16, 32 and n=32, 16. But other examples, such as (64, 8), (8, 64)in the example context of a 512 bit data block can be used. It will beappreciated that other data block sizes such as 1024 bits may be used.

To assist in decompression, in example arrangements each compressed datapacket includes format data indicating the groups used in the generationof that data packet and whether the first or second values of m and nwere used.

Another example embodiment provides data processing apparatuscomprising:

-   -   a first processing node (such as a processing element);    -   a second processing node (such as a data memory);    -   a data interconnection between the first processing node and the        second processing node; and    -   data compression circuitry to compress a set of data values to        be transmitted via the data interconnection from the first        processing node to the second processing node, the data        compression circuitry comprising:    -   detector circuitry to detect, for each of n complementary groups        of m data values of the set of data values, a first subset of        the groups for which the data values in the group have a        predetermined pattern of data values, where m and n are integers        and m×n is the number of data values in the set of data values;        and    -   generator circuitry to generate a compressed data packet        comprising at least:    -   a representation of a second subset of the groups, the second        subset being each of the n complementary groups other than        groups in the first subset; and    -   an indication of a group position, with respect to the set of        data values, of each group in the second subset of groups.

Compression techniques as discussed above can be used to compress datafor transmission from the first processing node to the second. The datacan be handled (for example, stored) at the second processing node inits compressed form, or in other examples, the data processing apparatuscan comprise data decompression circuitry to process a compressed datapacket received via the data interconnection from the first processingnode and to generate a set of output data values to be provided to thesecond processing node, the compressed data packet comprising at least arepresentation of a subset of n complementary groups of m data values ofa set of output data values, and an indication of a group position, withrespect to the set of output data values, of each group in the subset ofgroups;

-   -   the data decompression circuitry being configured to assemble        the set of output data values by inserting the subset of groups        at their respective group positions and setting other groups of        data values of the set of output data values to the        predetermined pattern of data values.

Another example embodiment provides apparatus comprising:

-   -   data decompression circuitry to process a compressed data packet        to generate a set of output data values, the compressed data        packet comprising at least a representation of a subset of n        complementary groups of m data values of a set of output data        values, and an indication of a group position, with respect to        the set of output data values, of each group in the subset of        groups;    -   the data decompression circuitry being configured to assemble        the set of output data values by inserting the subset of groups        at their respective group positions and setting other groups of        data values of the set of output data values to a predetermined        pattern of data values.

This arrangement provides a decompression apparatus complementary to thecompression apparatus discussed above.

In some examples, to assist in decompression, the compressed data packethas associated format data defining a compression format indicating atleast whether the groups of m data values each comprise:

-   -   groups of m contiguous data values of the set of data values; or    -   groups of every nth data value of the set of data values; and    -   the apparatus comprising a data store to store the format data        associated with a received compressed data packet.

The stored format data can be used to assist in subsequent recompressionof the same data, given that the compression format may already havebeen chosen by trial compression using various parameters and thenselecting the best set of parameters. To achieve this, the apparatus maycomprise data compression circuitry to process a set of data values, thedata compression circuitry comprising:

-   -   detector circuitry to detect, for each of n complementary groups        of m data values of the set of data values, a first subset of        the groups for which all of the data values in the group have a        predetermined pattern of data values, where m and n are integers        and m×n is the number of data values in the set of data values;    -   generator circuitry to generate a compressed data packet        comprising at least:    -   a representation of a second subset of the groups, the second        subset being each of the n complementary groups other than        groups in the first subset; and    -   an indication of a group position, with respect to the set of        data values, of each group in the second subset of groups;    -   in which, when the set of data values has been previously        decompressed by the apparatus, the detector circuitry is        configured to operate with respect to groups of m data values        defined by the format data held by the data store in respect of        the previous decompression of that set of data values.

Another example embodiment provides a data compression methodcomprising:

-   -   detecting, for each of n complementary groups of m data values        of the set of data values, a first subset of the groups for        which all of the data values in the group have a predetermined        pattern of data values, where m and n are integers and m×n is        the number of data values in the set of data values; and    -   generating a compressed data packet comprising at least:    -   a representation of a second subset of the groups, the second        subset being each of the n complementary groups other than        groups in the first subset; and    -   an indication of a group position, with respect to the set of        data values, of each group in the second subset of groups.

Another example embodiment provides a data decompression methodcomprising:

-   -   processing a compressed data packet to generate a set of output        data values, the compressed data packet comprising at least a        representation of a subset of n complementary groups of m data        values of a set of output data values, and an indication of a        group position, with respect to the set of output data values,        of each group in the subset of groups;    -   assembling the set of output data values by inserting the subset        of groups at their respective group positions and setting other        groups of data values to a predetermined pattern of data values.

FIG. 1 schematically illustrates a data processing apparatus 100comprising an integrated circuit device 110 such as a so-called systemon chip (SoC) and an external memory or DRAM (dynamic random accessmemory) 120.

The circuit 100 comprises various processing nodes such as a centralprocessing unit (CPU) 120 having a processing element (PE) 122, a level1 cache 124 and a level 2 cache 126; a graphics processing unit (GPU)130 having a processing element 132, a level 1 cache 134, aninterconnect 136, and a level 2 cache 138 linked to the processingelement 132 via the interconnect 136; a memory controller (DMC) 140 andone or more other processing nodes 150. The processing nodes 120, 130,140, 150 are interconnected by an interconnect 160.

The memory controller 140 provides an interface with the external memory120.

In operation, data can be transferred between the processing elements122, 132 and their respective caches 124, 126, 134, 138 and between thelevel 2 caches 126, 138 and external memory. In all of these instances,the data communication traffic can be considerable, particularly (thoughnot exclusively) in the case of data handled by the GPU 130. This canplace processing burdens on the interconnect 136 and the interconnect160 for example.

To alleviate this potential problem, data compression and decompressionarrangements can be provided. In FIG. 1, five locations, denoted byindicators A, B, C, D and E are potential locations for data compressionand/or decompression circuitry.

To explain the use of such compression and decompression circuitry, FIG.2 schematically illustrates data compression and decompression in thecontext of the apparatus of FIG. 1. Here, a processing node (node X) 200communicates data to a second processing node (node Y) 210 via a datacommunication path. The data communication path includes a compressionapparatus 220 which acts with respect to the uncompressed data 222provided by node X 200 and generates compressed data 224 fortransmission to node Y.

A complimentary decompression apparatus 230 acts on the compressed data234 to regenerate decompressed data 232 to be supplied to node Y. So, inthe context of data communications via a transmission or storage medium(for example, a transmission path) 240 between the compression apparatus220 and the decompression apparatus 230, which medium can include theinterconnect 136 or the interconnect 160, compressed data istransmitted. In some examples, the medium 240 has a limited bandwidthsuch as 64 bits per cycle and may consume power in handling the data224, both of which problems can be alleviated by using the presentcompression techniques. Depending upon the compression technique used,this can potentially be a smaller data quantity then would be the caseif uncompressed data were handled by that data communication path. Inturn, this can potentially lessen the processing or data communicationload for handling such data.

Referring back to FIG. 1, the data transmitting node, node X 200, couldbe, for example, the level 2 cache 126 and the data receiving node, nodeY, could be the memory controller 140. However, for data communicationin the other direction (for example, populating the level 2 cache 126from the main memory 120, the memory controller 140 could be thetransmitting node, node X, and the level 2 cache 126 could be thereceiving node, node Y.

In another example, communications in either direction between theprocessing element 132 and the level two cache 138 may be compressed forpassage via the interconnect 136.

So, for any of these examples, compression and decompression circuitrycan be provided at the following pairs of locations: (A, E), (B, C), (D,E).

The decompression apparatus is in one sense optional, given that wherethe recipient node is a memory or memory controller, the compressed datacan be stored or otherwise handled in its compressed form. So, in someexamples there is no need for a decompression circuitry to be used. Inother examples, however, particularly in order to avoid having toimplement significant changes to the circuitry or operation of therecipient node, a decompression apparatus 230 is indeed provided.

Note that in the context of the provision of compression anddecompression apparatus, the term “processing node” can include thenodes 120, 130, 140, 150 and/or elements within a processing node suchas the processing element 132 and the level 2 cache 138.

Various examples will now be considered, in order to explain theoperation of the compression and decompression arrangements of thepresent disclosure.

As discussed in detail below, FIG. 2 therefore provides an example ofdata processing apparatus comprising: a first processing node 200; asecond processing node 210; a data interconnection 224 between the firstprocessing node and the second processing node; and data compressioncircuitry 220 to compress a set of data values to be transmitted via thedata interconnection from the first processing node to the secondprocessing node, the data compression circuitry comprising (as discussedbelow): detector circuitry to detect, for each of n complementary groupsof m data values of the set of data values, a first subset of the groupsfor which the data values in the group have a predetermined pattern ofdata values, where m and n are integers and m×n is the number of datavalues in the set of data values; and generator circuitry to generate acompressed data packet comprising at least: a representation of a secondsubset of the groups, the second subset being each of the ncomplementary groups other than groups in the first subset; and anindication of a group position, with respect to the set of data values,of each group in the second subset of groups.

The apparatus of FIG. 2 may also optionally comprise data decompressioncircuitry 230 to process a compressed data packet received via the datainterconnection from the first processing node and to generate a set ofoutput data values to be provided to the second processing node, thecompressed data packet comprising at least a representation of a subsetof n complementary groups of m data values of a set of output datavalues, and an indication of a group position, with respect to the setof output data values, of each group in the subset of groups; the datadecompression circuitry being configured to assemble the set of outputdata values by inserting the subset of groups at their respective grouppositions and setting other groups of data values of the set of outputdata values to the predetermined pattern of data values.

FIG. 3 schematically illustrates a data block 300 of (in this example)512 data bits (512 b). For clarity, the representation 300 is in ahexadecimal format.

In the context of data transmissions between processing nodes of thetype discussed above, it may be the case that data blocks of this typecan contain predetermined patterns such as all-zero patterns of 16, 32,64, 128, 256 or 512 bits or data values, given that in some applicationsunused parts of a memory structure are zero-padded. In order to assistin visualising the location of such patterns, the block 300 is arrangedin binary form in FIG. 3 as 16 rows 310 each of 32 bits. The rows areformed as successive groups of m contiguous bits of the block 300, wherem is 32 in this example. There are n (16) such groups. m×n (16×32) isequal to the block size (512 bits). The arrangement into rows 310 issimply to assist in visualisation and is not necessarily a physical orlogical requirement of the circuitry. It can be seen in FIG. 3 thatalternate rows as drawn, forming a first subset of the rows or groups,are populated by all zero values. The other rows, forming a secondsubset of the rows or groups, are populated by various data values whichare non-zero.

As discussed below, in the present technique, the all-zero rows of thefirst subset are not transmitted, given that these represent apredetermined pattern (for example all having a predetermined data valuesuch as all zeroes) which can be reconstructed at the decompressionapparatus. The other, second subset of rows are transmitted, as datavalues 400 (FIG. 4) forming a representation of those rows along with anindication 410 of the position of each row in the array of rows 310 ofFIG. 3. The indication is provided as a shift (<<) indication of anumber of row sizes within the block to be reconstructed, using an ORlogical combination (“I”) to combine with the all-zero initialpopulation of the output pattern.

In the example of FIG. 4, the transmission of the rows value 400requires 32×8 (256) bits and the transmission of the indication 410requires 4×8=32 bits. This means that instead of transmitting 512 bitsfor the uncompressed block 300, 288 bits can in fact be transmitted.

In an example arrangement with a 64 bit bus width, the transmission of512 bits would take 8 data “beats” or transmission instances, each of 64bits, whereas the transmission of the 288 bits requires 5 such databeats.

Another example will now be described with reference to FIGS. 5 to 7.

In FIG. 5, a 512-bit block 500 is represented as 32 rows of 16 bits,drawn as two columns 510, 520 of 16 bit groups. Once again, it can beseen that sixteen of the 16 bit groups in the column 510 are all of apredetermined pattern, such as all-zero values. So, using the techniquediscussed above, the remaining 16 rows or groups in the column 520 canbe transmitted as representations 600 (FIG. 6) each of 16 bits, alongwith indications 610 of the group position within the original block500. Here, the indications 610 require 5 bits each in order to encode aposition within a set of 32 rows, so that the total data amount in FIG.6 is 16×16 bits for the representations 600 (256 bits) plus 16×5 bits=80bits, or a total of 336 bits, compared to the 512 bits to transmit thewhole block 500.

FIG. 7a schematically represents a technique allowing the data to becompressed even further by applying a mask or key using, for example, anexclusive OR (XOR) operation that has the effect of reversiblyconverting data bits with a value of 1 to 0. In some examples, this maskor key can be applied to rows or columns of bits as drawn. Othertechniques for applying a mask are discussed below.

In FIG. 7a , a mask value or key group 700 is shown, along with the datain the right hand column 710 resulting from the bitwise XOR combinationof the right hand column of FIG. 5 520 with the key data 700. It can beseen that several rows, which previously had non-zero values, now haveall zeroes so that they do not need to be transmitted either. In fact,six rows of the right hand column no longer need to be transmitted,saving (16+5) bits for each such non-transmitted row, or a total savingof 126 bits by using the mask 700.

Note that in FIG. 7a , the groups are 16 bits long (m=16) but the XORmask is 32 bits long (k=32). The XOR mask in this example is an integermultiple of the length of the groups, so that (in this example) twogroups are covered by one instance of the mask, but this does not haveto be the case. More generally, the XOR mask could simply be appliedrepeatedly through the input data. The XOR mask could be applied aninteger number of times (if it is an integer divisor of the input datalength) or could truncate early at a last instance of application ifnot. However, although all of these generalities are possible, asignificant use of the XOR mask is to align with repeated patterns inthe input data, just as the division into m×n blocks is also aiming todo this, so that in many practical example situations it is likely thatthe XOR mask would indeed be an integer multiple of m in length.

So, in general, there are n groups of m bits in the set of input data,and the k bit key value is applied contiguously to the set of inputdata. That is to say, starting at a particular location in the set ofinput data, the k-bit key is applied to k bits, then applied to a next kbits, then a next k bits and so on, so that all bits of the set of inputdata have a respective bit of the k-bit key group applied to them. Asmentioned, in some cases, there will be a resonance such that m and kare related by an integer relationship, but this is not a requirement.

FIG. 7b schematically represents a compressed data block based on theinput data of FIG. 7a . The compressed data block includes arepresentation of the XOR mask followed by the non-zero 16 bit rows ofFIG. 7 a.

Note that in some examples given below, a compressed data block may alsoprovide format information defining, for example, a type of combinationused (in place of XOR for example) and/or the variables m and n, butthis is not shown in FIG. 7b for clarity of the diagram.

FIG. 8 schematically illustrates another example 800 of a data block anda visualisation 810 of the data block 800 visualised as 32 columns of 16bits (or in other words, 16 instances of every 32^(nd) bit of theoriginal group).

In FIG. 9, key data 900 is applied and combined with each row by an XORoperation so as to generate a processed set of data 910. This can thenbe encoded column-by column such that columns which are all-zero bits(representing the predetermined pattern) are not transmitted, but arepresentation of other columns such as the columns 920 and 930 istransmitted as data 1000 (FIG. 10) along with an indication 1010 of thecolumn address within the data block.

FIGS. 11a-c schematically represent another example relating to anexample commonly occurring pattern in a GPU memory read or in similardata blocks. Note that the pattern itself is merely an example; thediscussion is about any such pattern which occurs commonly, for examplein this type of data.

An example 512 bit data block 1180 is partitioned as discussed aboveinto 16 rows 1185 of 32 bits (FIG. 11a ). A common pattern is detectedand used as a 32 bit XOR mask applied to each row. So here, m=k=32.Thisgenerates just four remaining non-zero rows, so that (FIG. 11c ) thecompressed data block simply needs to define the XOR key data and four16-bit rows, a total of 336 bits.

FIG. 12a schematically illustrates a data compression apparatus. A datablock 1100 such as a 512 bit data block is provided to data formattingcircuitry 1110 which, for example, formats the data as n complimentarygroups of m data values, such as a set of rows or a set of columns asdiscussed above.

Key processing circuitry 1120 creates and applies an XOR key value tothe formatted data groups, or at least to groups which are not alreadyof the predetermined pattern such as all zeroes.

In order to generate a key value, the circuitry 1120 can detect bitpositions of the groups where at least a threshold proportion of thegroups have, for example, a value of 1 at that bit position. For any bitpositions which meet the threshold proportion, a 1 is applied to thatbit position of the X or key value. For example, the thresholdproportion can in fact be a threshold such that all groups have to havea 1 at that bit position.

The XOR key is then applied by an XOR operation to each of the groups.

A detector 1130 detects rows or columns (groups) resulting from the keyprocessing which have all-zero values (the predetermined pattern). Theseare allocated to a first subset of groups and do not need to beexplicitly encoded. Other groups are allocated to a second subset whichwill require encoding. This results in an indication 1140 of the size ofthe encoded data, namely the number of groups in the second subsetmultiplied by the groups size in bits, plus the number of groups in thesecond subset multiplied by the number of bits required to encode agroup location (log₂(number of groups)), plus (if the key value is beingsent) the number of bits of the key value. Finally, an encoder 1150encodes a compressed data packet (CDP) 1160 indicating the second subsetof groups and their respective group locations. The CDP may also includethe XOR key value generated by the circuitry 1120.

FIG. 12a therefore provides an example of apparatus comprising: datacompression circuitry to process a set of data values, the datacompression circuitry comprising: detector circuitry 1130 to detect, foreach of n complementary groups of m data values of the set of datavalues, a first subset of the groups for which the data values in thegroup have a predetermined pattern of data values, where m and n areintegers and m×n is the number of data values in the set of data values;and generator circuitry 1150 to generate a compressed data packetcomprising at least: a representation of a second subset of the groups,the second subset being each of the n complementary groups other thangroups in the first subset; and an indication of a group position, withrespect to the set of data values, of each group in the second subset ofgroups.

FIG. 12b schematically illustrates, as an alternative to the XOR keyprocessor 1120, an arithmetic key processor 1122. This can operate in asimilar manner to the XOR key processor 1120 to increase the number ofgroups having the predetermined pattern, by applying (adding orsubtracting) a multi-bit arithmetic key value which can then besubtracted or added back (respectively) at the decompression side. Forexample, the arithmetic key processor 1122 could generate the key valueas a negation of a most commonly occurring group value.

The key processors 1120, 1122 provide examples (where the data valuescomprise respective data bits) in which the data compression circuitrycomprises combiner circuitry 1120, 1122 to combine each group of m datavalues with bits of an k-bit key group applied contiguously to the setof data values to generate a respective combined group, the detectorcircuitry operating with respect to the combined groups. For example,the combiner circuitry may be configured to apply a combination selectedfrom the list consisting of: (i) a bitwise exclusive-OR combination toeach group of m data values and bits of the k-bit key group; and (ii) anarithmetic combination of each group of m data values and bits of thek-bit key group. The combiner circuitry 1120, 1122 can be configured togenerate the k-bit key group. In the case of an XOR combination, thecombiner circuitry can be configured to set each bit position of thecoding value to one when at least a threshold proportion of instances ofthe m-bit groups have a one at that bit position. Note that thecombination can be with one set of groups (rows/columns) but theencoding can be according to another set of groups (columns/rows) asshown in the example of FIGS. 9 and 10.

The arrangements of FIGS. 11a and 11b relate to the technique discussedhere as applied to one particular format (a format defining the valuesm, n, the type of groups (whether m contiguous data values or every nthdata value are used) and the like. In fact, multiple formats can betreated in this way using circuitry as shown in FIG. 13, comprisingmultiple instances 1200 of the circuitry of FIG. 11 and output circuitrysuch as a multiplexer 1210 arranged to select one of the CDPs 1160generated by the instances 1200 or the uncompressed (raw) data block1220, on the basis of the size indications 1140 from each of theinstances 1200. The output circuitry 1210 may, for example, select oneof the compressed data packets or the raw data in dependence upon whichof the raw data and the compressed data packets represents a smalleramount of output data 1230.

The output circuitry 1210 provides an example of output circuitry tooutput either the set of data values or the compressed data packet, independence upon which of the set of data values and the compressed datapacket represents a smaller amount of data.

Therefore, FIG. 13 provides an example in which two or more instances ofdata compression circuitry 1200 are used, to perform data compression togenerate respective compressed data packets using: groups of mcontiguous data values of the set of data values; and groups of everynth data value of the set of data values; and in which: the outputcircuitry 1210 is configured to output either the set of data values orone of the compressed data packets, in dependence upon which of the setof data values and the compressed data packets represents a smalleramount of data. In FIG. 13, at least four instances of data compressioncircuitry may be used, to perform data compression to generaterespective compressed data packets using: (i) groups of m contiguousdata values of the set of data values for a first value of m; (ii)groups of every nth data value of the set of data values for a firstvalue of n; (iii) groups of m contiguous data values of the set of datavalues for a second value of m; and (iv) groups of every nth data valueof the set of data values for a second value of n.

The trial encoding arrangements of FIG. 13 can be extended to trials ofdifferent key lengths k, for example including m, 2 m, 0.5 m and thelike as candidate values of k.

FIG. 14 schematically illustrates an example data packet comprisingformat data 1300 indicating values for m, n and the type of group (ncontiguous data values or every nth data value) used, an XOR orarithmetic key value 1310 and payload data 1320 comprisingrepresentations of the second subset of groups and for each suchrepresentation of a group position. The field 1310 provides an examplein which the compressed data packet includes a representation of thek-bit key group.

Therefore, in these examples, the compressed data packet of FIG. 14 hasassociated format data 1300 defining a compression format indicating atleast whether the groups of m data values each comprise: groups of mcontiguous data values of the set of data values; or groups of every nthdata value of the set of data values. Generally, the format data mayindicate the groups used in the generation of that data packet andwhether first or second values of m and n were used.

FIG. 15 schematically illustrates a set of options for use with FIG. 13,in which various values 1400 of n, m are provided and either row orcolumn compression is used (representing groups of m contiguous datavalues or groups of every nth data value respectively) with or withoutthe use of a key as discussed above each of these can be handled by aninstance 1200 in FIG. 13 and one of them, or the raw data, selected independence on which gives the lowest amount of data to be transmitted.

In FIG. 15, the first value of m is equal to the second value of n; andthe second value of m is equal to the first value of n (for example, 16;32).

FIG. 16a schematically illustrates a data decompression apparatus inwhich a compressed data packet 1500 is received by a packet decoder orparser 1510 which outputs the key data 1520, format data 1530 indicatingm, n and the type of group used, and the representations of groups inthe second subset 1540 along with their position indications.

An output buffer 1560 is initially populated with the predeterminedpattern (such as all zeroes) according to the format defined by theformat data 1530 by a pattern generator 1570, and then write logic 1580generates representations 1585 of the second subset of groups forwriting to group positions defined by the associated position data inthe output buffer, again making use of the format data to indicate thetype of groups in use.

The key data 1520 is combined with the representations 1585 by acombiner 1550 and the results are written to the output buffer 1560. Inthe case of the compression apparatus using a bitwise XOR combination,the combiner 1550 also uses a bitwise XOR combination. In the case of anarithmetic key, the combiner 1550 uses an arithmetic combination.

In example arrangements, either the key data is combined with all of thearray of data including the pre-populated zeroes generated by the outputbuffer and indicated by a broken-line path to the combiner 1550) or theoutput buffer can be pre-populated with multiple instances of datadependent upon the key data (such as the key value itself, in the caseof an XOR mask) and then overwritten for eth second subset only via thecombiner.

The decompressed data 1590 is then ready for output by the output buffer1560.

FIG. 16a therefore provides an example of apparatus comprising:

-   -   data decompression circuitry 1510, 1550 to process a compressed        data packet to generate a set of output data values, the        compressed data packet comprising at least a representation of a        subset of n complementary groups of m data values of a set of        output data values, and an indication of a group position, with        respect to the set of output data values, of each group in the        subset of groups; and    -   the data decompression circuitry (1580, 1560, 1570) being        configured to assemble the set of output data values by        inserting the subset of groups at their respective group        positions and setting other groups of data values of the set of        output data values to a predetermined pattern of data values.

FIG. 16b schematically illustrates the output buffer 1560, in an examplewhere a row-wise encoding is being used. Initially the pattern generator1570 populates rows of data 1595 in the output buffer with all zeroes(or whatever the predetermined pattern is), then the write logic writesrows of data into certain ones of the rows 1595 according to theindications associated with the received row data.

The process discussed above to select a compression format involvesmultiple trial compressions. Once this has been performed for aparticular data block, it remains a property of that data block thatthis will be the best compression format to use in respect of that datablock, as long as the data block remains unchanged.

Referring to FIG. 17, which schematically illustrates a decompressionapparatus, the format data for a received encoded data block can bestored by a cache 1600, for example in association with a memory address1650 used for storage of the decompressed data in a memory 1620 such asthe main memory 120 of FIG. 1. So, the compressed data packet 1630 isreceived and processed by decompression apparatus 1640 of the type shownin FIG. 16a , leading to the generation of decompressed data 1645 andthe output to the cache 1600 of the format data 1647 from the packetdecoder 1510 of FIG. 16a . Address information 1650 relating to the datahandling operation for which the data is being transmitted is used toidentify a location in the cache 1600 at which the format data 1647 istemporarily stored. The data 1645 is then stored to the memory 1620 onthe basis of the address 1650.

Therefore, the apparatus of FIG. 17 comprises a data store or cache 1600to store the format data 1647 associated with a received compressed datapacket.

Subsequently, when the same data block is to be transmitted elsewhere,either back to the original sending node or to another node, the datablock is read from memory as data 1660 and provided to compressionapparatus 1670. Here, only one instance of the compression apparatus ofFIG. 11 needs to be used, because it can operate on the basis of formatdata 1675 read from the cache 1600 according to the address 1677 of thedata just read from the memory 1620. The compression apparatus 1670applies the cached format to compress the data 1660 to generate anoutput compressed data packet 1680 for onward transmission, without theneed for multiple trial encodings.

The circuitry 1670 (as an instance of FIG. 11) provides an example ofdata compression circuitry to process a set of data values, the datacompression circuitry comprising: detector circuitry to detect, for eachof n complementary groups of m data values of the set of data values, afirst subset of the groups for which all of the data values in the grouphave a predetermined pattern of data values, where m and n are integersand m×n is the number of data values in the set of data values;generator circuitry to generate a compressed data packet comprising atleast: a representation of a second subset of the groups, the secondsubset being each of the n complementary groups other than groups in thefirst subset; and an indication of a group position, with respect to theset of data values, of each group in the second subset of groups; inwhich, when the set of data values has been previously decompressed bythe apparatus, the detector circuitry is configured to operate withrespect to groups of m data values defined by the format data 1675 heldby the data store 1600 in respect of the previous decompression of thatset of data values.

FIG. 18 is a schematic flowchart illustrating a data compression methodcomprising:

-   -   detecting (at a step 1700), for each of n complementary groups        of m data values of the set of data values, a first subset of        the groups for which all of the data values in the group have a        predetermined pattern of data values, where m and n are integers        and m×n is the number of data values in the set of data values;        and    -   generating (at a step 1710) a compressed data packet comprising        at least:    -   a representation of a second subset of the groups, the second        subset being each of the n complementary groups other than        groups in the first subset; and    -   an indication of a group position, with respect to the set of        data values, of each group in the second subset of groups.

FIG. 19 is a schematic flowchart illustrating a data decompressionmethod comprising:

-   -   processing (at a step 1800) a compressed data packet to generate        a set of output data values, the compressed data packet        comprising at least a representation of a subset of n        complementary groups of m data values of a set of output data        values, and an indication of a group position, with respect to        the set of output data values, of each group in the subset of        groups; and    -   assembling (at a step 1810) the set of output data values by        inserting the subset of groups at their respective group        positions and setting other groups of data values to a        predetermined pattern of data values.

In the present application, the words “configured to . . . ” are used tomean that an element of an apparatus has a configuration able to carryout the defined operation. In this context, a “configuration” means anarrangement or manner of interconnection of hardware or software. Forexample, the apparatus may have dedicated hardware which provides thedefined operation, or a processor or other processing device may beprogrammed to perform the function, in which case software or programinstructions by which the function is performed, and a providing mediumsuch as a non-transitory machine-readable medium by which such softwareor program instructions are provided (for example, stored) areconsidered to represent embodiments of the disclosure. “Configured to”does not imply that the apparatus element needs to be changed in any wayin order to provide the defined operation.

Although illustrative embodiments of the present techniques have beendescribed in detail herein with reference to the accompanying drawings,it is to be understood that the present techniques are not limited tothose precise embodiments, and that various changes, additions andmodifications can be effected therein by one skilled in the art withoutdeparting from the scope and spirit of the techniques as defined by theappended claims. For example, various combinations of the features ofthe dependent claims could be made with the features of the independentclaims without departing from the scope of the present techniques.

1. Apparatus comprising: data compression circuitry to process a set ofdata values, the data compression circuitry comprising: detectorcircuitry to detect, for each of n complementary groups of m data valuesof the set of data values, a first subset of the groups for which thedata values in the group have a predetermined pattern of data values,where m and n are integers and m×n is the number of data values in theset of data values; and generator circuitry to generate a compresseddata packet comprising at least: a representation of a second subset ofthe groups, the second subset being each of the n complementary groupsother than groups in the first subset; and an indication of a groupposition, with respect to the set of data values, of each group in thesecond subset of groups.
 2. Apparatus according to claim 1, in which thepredetermined pattern comprises all data values in the group having apredetermined data value.
 3. Apparatus according to claim 1, comprising:output circuitry to output either the set of data values or thecompressed data packet, in dependence upon which of the set of datavalues and the compressed data packet represents a smaller amount ofdata.
 4. Apparatus according to claim 1, in which the groups of datavalues comprise: groups of m contiguous data values of the set of datavalues; or groups of every nth data value of the set of data values. 5.Apparatus according to claim 1, in which: the data values compriserespective data bits; and the data compression circuitry comprisescombiner circuitry to combine each group of m data values with bits ofan k-bit key group applied contiguously to the set of data values togenerate a respective combined group, the detector circuitry operatingwith respect to the combined groups.
 6. Apparatus according to claim 5,in which the combiner circuitry is configured to apply a combinationselected from the list consisting of: (i) a bitwise exclusive-ORcombination to each group of m data values and bits of the k-bit keygroup; and (ii) an arithmetic combination of each group of m data valuesand bits of the k-bit key group.
 7. Apparatus according to claim 5, inwhich the compressed data packet includes a representation of the k-bitkey group.
 8. Apparatus according to claim 6, in which the combinercircuitry is configured to generate the k-bit key group.
 9. Apparatusaccording to claim 8, in which, for a bitwise exclusive-OR combination,the combiner circuitry is configured to set each bit position of thecoding value to one when at least a threshold proportion of instances ofthe m-bit groups have a one at that bit position.
 10. Apparatusaccording to claim 2, comprising two or more instances of datacompression circuitry, to perform data compression to generaterespective compressed data packets using: groups of m contiguous datavalues of the set of data values; and groups of every nth data value ofthe set of data values; and in which: the output circuitry is configuredto output either the set of data values or one of the compressed datapackets, in dependence upon which of the set of data values and thecompressed data packets represents a smaller amount of data. 11.Apparatus according to claim 10, comprising at least four instances ofdata compression circuitry, to perform data compression to generaterespective compressed data packets using: (i) groups of m contiguousdata values of the set of data values for a first value of m; (ii)groups of every nth data value of the set of data values for a firstvalue of n; (iii) groups of m contiguous data values of the set of datavalues for a second value of m; and (iv) groups of every nth data valueof the set of data values for a second value of n.
 12. Apparatusaccording to claim 11, in which the first value of m is equal to thesecond value of n; and the second value of m is equal to the first valueof n.
 13. Apparatus according to claim 11, in which each compressed datapacket includes format data indicating the groups used in the generationof that data packet and whether the first or second values of m and nwere used.
 14. Data processing apparatus comprising: a first processingnode; a second processing node; a data interconnection between the firstprocessing node and the second processing node; and data compressioncircuitry to compress a set of data values to be transmitted via thedata interconnection from the first processing node to the secondprocessing node, the data compression circuitry comprising: detectorcircuitry to detect, for each of n complementary groups of m data valuesof the set of data values, a first subset of the groups for which thedata values in the group have a predetermined pattern of data values,where m and n are integers and m×n is the number of data values in theset of data values; and generator circuitry to generate a compresseddata packet comprising at least: a representation of a second subset ofthe groups, the second subset being each of the n complementary groupsother than groups in the first subset; and an indication of a groupposition, with respect to the set of data values, of each group in thesecond subset of groups.
 15. Data processing apparatus according toclaim 14, comprising: data decompression circuitry to process acompressed data packet received via the data interconnection from thefirst processing node and to generate a set of output data values to beprovided to the second processing node, the compressed data packetcomprising at least a representation of a subset of n complementarygroups of m data values of a set of output data values, and anindication of a group position, with respect to the set of output datavalues, of each group in the subset of groups; the data decompressioncircuitry being configured to assemble the set of output data values byinserting the subset of groups at their respective group positions andsetting other groups of data values of the set of output data values tothe predetermined pattern of data values.
 16. Apparatus comprising: datadecompression circuitry to process a compressed data packet to generatea set of output data values, the compressed data packet comprising atleast a representation of a subset of n complementary groups of m datavalues of a set of output data values, and an indication of a groupposition, with respect to the set of output data values, of each groupin the subset of groups; and the data decompression circuitry beingconfigured to assemble the set of output data values by inserting thesubset of groups at their respective group positions and setting othergroups of data values of the set of output data values to apredetermined pattern of data values.
 17. Apparatus according to claim16, in which the compressed data packet has associated format datadefining a compression format indicating at least whether the groups ofm data values each comprise: groups of m contiguous data values of theset of data values; or groups of every nth data value of the set of datavalues; the apparatus comprising a data store to store the format dataassociated with a received compressed data packet.
 18. Apparatusaccording to claim 17, comprising: data compression circuitry to processa set of data values, the data compression circuitry comprising:detector circuitry to detect, for each of n complementary groups of mdata values of the set of data values, a first subset of the groups forwhich all of the data values in the group have a predetermined patternof data values, where m and n are integers and m×n is the number of datavalues in the set of data values; generator circuitry to generate acompressed data packet comprising at least: a representation of a secondsubset of the groups, the second subset being each of the ncomplementary groups other than groups in the first subset; and anindication of a group position, with respect to the set of data values,of each group in the second subset of groups; in which, when the set ofdata values has been previously decompressed by the apparatus, thedetector circuitry is configured to operate with respect to groups of mdata values defined by the format data held by the data store in respectof the previous decompression of that set of data values.
 19. A datacompression method comprising: detecting, for each of n complementarygroups of m data values of the set of data values, a first subset of thegroups for which all of the data values in the group have apredetermined pattern of data values, where m and n are integers and m×nis the number of data values in the set of data values; and generating acompressed data packet comprising at least: a representation of a secondsubset of the groups, the second subset being each of the ncomplementary groups other than groups in the first subset; and anindication of a group position, with respect to the set of data values,of each group in the second subset of groups.
 20. A data decompressionmethod comprising: processing a compressed data packet to generate a setof output data values, the compressed data packet comprising at least arepresentation of a subset of n complementary groups of m data values ofa set of output data values, and an indication of a group position, withrespect to the set of output data values, of each group in the subset ofgroups; and assembling the set of output data values by inserting thesubset of groups at their respective group positions and setting othergroups of data values to a predetermined pattern of data values.